package com.example.yingjiguanli_demo.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.yingjiguanli_demo.pojo.LoginLog;
import com.example.yingjiguanli_demo.mapper.LoginLogMapper;
import com.example.yingjiguanli_demo.pojo.Result;
import com.example.yingjiguanli_demo.service.ILoginLogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author scj
 * @since 2024-11-14
 */
@Service
public class LoginLogServiceImpl extends ServiceImpl<LoginLogMapper, LoginLog> implements ILoginLogService {
    @Autowired
    private LoginLogMapper loginLogMapper;

    /***
     * 查询登录日志列表
     * @return Result<List<LoginLog>>
     */
    @Override
    public Result<List<LoginLog>> getLoginLogList() {
        QueryWrapper<LoginLog> queryWrapper = new QueryWrapper<>();
        List<LoginLog> loginLogs = loginLogMapper.selectList(queryWrapper);
        return Result.success(loginLogs);
    }
}
